import { defineConfig } from 'vite'
import react from '@vitejs/plugin-react'
import Yasuo from 'vite-plugin-compression'
import Qulog from 'vite-plugin-remove-console'
// https://vite.dev/config/
export default defineConfig({
  plugins: [
    react(),
    Yasuo({
      algorithm:'gzip'
    }),
    Qulog()
  ],
  server: {
    proxy: {
      '/api': {
        target: 'http://172.27.2.110',
        changeOrigin: true,
        rewrite: (path) => path.replace(/^\/api/, ''),
      },
    }
  },
  build: {
    rollupOptions: {
      output: {
        assetFileNames: '[ext]/[name]-[hash].[ext]',
        chunkFileNames: 'js/[name]-[hash].js'
      }
    }
  }
})
